<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('user_addresses', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->cascadeOnDelete();
            $table->string('name')->comment('收件人姓名');
            $table->string('phone')->comment('收件人手机号');
            $table->string('city')->comment('城市');
            $table->string('province')->comment('省');
            $table->string('is_default')->default('2')->comment('是否默认地址:1/是 2/否');
            $table->string('address_line')->comment('详细地址');
            $table->string('status')->default('1')->comment('状态');
            $table->unsignedBigInteger('order')->default(1)->comment('排序');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_addresses');
    }
};
